package ch.zbw.pra.sysventory.database.mapper;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import ch.zbw.pra.sysventory.model.HardDisk;

/**
 * Mapping von einem Resultset auf ein Harddisk Objekt
 * 
 * @author Roberto Lucas
 */

public class HardDiskMapper implements RowMapper<HardDisk>, Serializable {

	private static final long serialVersionUID = -785160099613188193L;

	public HardDisk mapRow(ResultSet rs, int rowNum) throws SQLException {
		HardDisk hardDisk = new HardDisk();
		hardDisk.setId(rs.getInt("hardID_pk"));
		hardDisk.setDriveLetter(rs.getString("hardDriveLetter"));
		hardDisk.setHardDiskCapacity(rs.getString("hardCapacity"));
		hardDisk.setHardDiskFreeSpace(rs.getString("hardFreeSpace"));
		hardDisk.setHardDiskEfficiency(rs.getString("hardEfficiency"));

		return hardDisk;
	}

}
